home *** CD-ROM | disk | FTP | other *** search
- %
- #EF
- #T15,1,Chapter 6 The Borland Graphics Interface Pg. 17
- #HS,1,4,80,25,11,1
- #C4,R5
- ~W~IText Output With The BGI~Y~I
-
- There are several text output functions for use in graphics modes. These
- are ~R~Idifferent functions ~Y~Ithan we would use when writing text in text mode.
-
- #WN
- Borland provides us with a few standard fonts. Some fonts are |bitmapped|
- and some are |stroked|. In general, it is better to used stroked fonts than
- bitmapped fonts. In Space Attackers, we'll use one of each just to show how
- it's done.
-
- #WN
- #C4,R15
- The Turbo C/Turbo C++ text output functions for graphics modes are
- summarized in Figure 6.3, which begins on the next page.
-
- #WN
- %
- #EF
- #T15,1,Chapter 6 The Borland Graphics Interface Pg. 18
- #HS,1,4,80,25,11,1
- #C2,R5
- ~W~IFigure 6.3~Y~I
- Summary Of The BGI
- Text Output Functions For Graphics Modes
-
- ╔═══════════════════════════════════════════════════════════════════════════╗
- ║ ~W~IName Purpose ~Y~I ║
- ╙───────────────────────────────────────────────────────────────────────────╜
- gettextsettings() Gets information about the current font. Includes
- the size, direction, and justification.
- outtext() Outputs text in the current font at the current
- position.
- outtextxy() Outputs text in the current font at the position
- specified by the parameters x,y.
- registerbgifont() Tells the BGI that a font has been linked to the
- program. This is very similar to using
- registerbgidriver().
- settextjustify() Sets the text justification. Text may be left,
- center, or right justified on a specified point.
- #C28,R24
- ~C~IContinued On Next Page~Y~I
- #WP
- %
- #EF
- #T15,1,Chapter 6 The Borland Graphics Interface Pg. 19
- #HS,1,4,80,25,11,1
- #C2,R5
- ~W~IFigure 6.3 (cont)~Y~I
- Summary Of The BGI
- Text Output Functions For Graphics Modes
-
- ╔═══════════════════════════════════════════════════════════════════════════╗
- ║ ~W~IName Purpose ~Y~I ║
- ╙───────────────────────────────────────────────────────────────────────────╜
- settextstyle() Sets the current font, the direction it's printed
- in, and the character size.
- setusercharsize() Sets the size of the current text fonts. This
- should really only be used with stroked fonts.
- The bitmapped fonts look terrible when you shrink
- or enlarge them.
- textheight() Returns the height in pixels of a text string.
- Good for helping you position text relative to a
- position on the screen.
- textwidth() Returns the width in pixels of a text string. Also
- very useful for calculating relative positions on
- the screen.
-
- #WP
- #X